<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>主</title>
<import type='css' file="css.main" />
<load href="__PUBLIC__/js/jquery-1.9.1.min.js" />
<import type='js' file="js.main" />
<style type="text/css">
.asidinfo1{text-align:right; margin-bottom:3px; overflow:hidden;}
.asidinfo1 a{color:#fff; padding:2px 10px; border-radius:3px; background-color:#e83535; display:block; float:right; height:28px; line-height:28px;}
</style>
</head>

<body>
<div class="main-frame">
	<div class="position">华人码 > 资源分类列表</div>
	<div class="asidinfo1"><a href="{:U('resourceadd')}">添加顶级分类</a></div>
	<div class="table-list">
	 <table width="100%" border="1" cellspacing="0" cellpadding="0" class="indextable">
		    <tr class="th-bg">
		      <th width="5%">id</th>
		      <th width="60%">资源分类名称</th>
		      <th width="10%">创建时间</th>
		      <th width="15%" style="text-align:right">操作</th>
	        </tr>
	        <volist name='data' id='data'>
	        <if condition="$data['pid'] eq 0">
		    <tr class="tr-line">
		      <td>{$data.id}</td>
		      <td style="text-align:left;"><a href="/Admin/Ysheng/ylist/tpid/{$data['id']}.html">{$data.typename}</a></td>
		      <td>{$data.typedate}</td>
		      <td style="text-align:right;">
		        <a href="/resource/{$data['id']}.html" target="_blank" style="background-color:#ff8b8b; padding:2px 10px; border-radius:3px; color:#fff;">预览</a>&nbsp;&nbsp;
				<a href="{:U('resourceadd',array('id'=>$data['id'],'pid'=>$data['pid']))}">添加子分类</a> /
		      	<a href="{:U('editsubresource',array('id'=>$data['id']))}">编辑</a> / 
		      	<a class="resdel" refurl="{:U('deletesubresource',array('id'=>$data['id']))}">删除</a>
		      </td>
	        </tr>

		        <volist name='data1' id='v'>
		        <if condition="$v['pid'] eq $data['id']">
			    <tr class="tr-line">
			      <td>{$v.id}</td>
			      <td style="text-align:left; padding-left:20px;">—— <a href="/Admin/Ysheng/ylist/tpid/{$v['id']}.html">{$v.typename}</a></td>
			      <td>{$v.typedate}</td>
			      <td style="text-align:right;">
			      	<a href="{:U('editsubresource',array('id'=>$v['id']))}">编辑</a> / 
			      	<a class="resdel" refurl="{:U('deletesubresource',array('id'=>$v['id']))}">删除</a>
			      </td>
		        </tr>
		        </if>
		        </volist>
		        
		    </if>
	        </volist>
      </table>
    </div>
</div>
<script type="text/javascript">
$(function(){
	$("a.resdel").each(function(index, element) {
		var t = $(this);
		t.click(function(){
			var r=confirm("想好！确定要删除吗？");
			if (r==true){
				var refurl = $(this).attr('refurl');
				location.href = refurl;
			}else{
				return false;
			}
		})
	});
})
</script>
</body>
</html>
